<?php



namespace App\Services\Other\Models;

use Illuminate\Database\Eloquent\Model;

class Location extends Model
{

    protected $table = 'location';

    protected $fillable = [
        'name', 'level','parent_id'
    ];

    public function parent()
    {
        return $this->belongsTo(Location::class, 'parent_id');
    }

    public function children()
    {
        return $this->hasMany(Location::class, 'parent_id');
    }
}

